package com.process.service.impl;

import com.auth.custom.LoginUserInfoHelper;
import com.auth.model.process.ProcessRecord;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.process.mapper.OaProcessRecordMapper;
import com.process.service.OaProcessRecordService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 审批记录 服务实现类
 * </p>
 *
 * @author tang
 * @since 2023-07-23
 */
@Service
public class OaProcessRecordServiceImpl extends ServiceImpl<OaProcessRecordMapper, ProcessRecord> implements OaProcessRecordService {

    @Override
    public void record(Long processId, Integer status, String description) {
        ProcessRecord processRecord = new ProcessRecord();
        processRecord.setProcessId(processId);
        processRecord.setDescription(description);
        processRecord.setStatus(status);
        processRecord.setOperateUserId(LoginUserInfoHelper.getUserId());
        processRecord.setOperateUser(LoginUserInfoHelper.getUsername());
        baseMapper.insert(processRecord);

    }
}
